package com.kernel.streamDemo;

import com.kernel.entity.Person;

import java.io.*;

/****************************************
 * @name ObjectInputStreamDemo
 * @description 对象反序列化演示
 * @author 黄彬恒
 * @since 2018/8/21
 ***************************************/
public class ObjectInputStreamDemo {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        File file = new File("D:\\ideaProgram\\IOLearning\\src\\main\\resources\\testDir\\person.txt");
        ObjectInputStream ois;
        ois = new ObjectInputStream(new FileInputStream(file));
        Object o = ois.readObject();
        Person person = (Person) o;
        System.out.println(person.toString());
    }
}
